Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NoMethodError in Bugsnag Railtie #666

Merged
merged 1 commit into from
Jun 22, 2021

Conversation

imjoehaines
Copy link
Contributor

@imjoehaines imjoehaines commented Jun 21, 2021

Goal

This can happen if Bugsnag is added to the Gemfile with require: false. In this case, require "bugsnag" in a Rails initializer will run the config.before_initialize before the rest of the class has executed. This results in the 'event_subscription' method being undefined as it is declared below the line that calls it

By moving the method definition to the top of the file, this is no longer a problem

See #653

This can happen if Bugsnag is added to the Gemfile with 'require: false'.
In this case, 'require "bugsnag"' in a Rails initializer will run the
'config.before_initialize' before the rest of the Railtie has been
executed. This results in the 'event_subscription' method being
undefined as it was declared below the line that calls it

By moving it to the top of the file this is no longer a problem
@imjoehaines imjoehaines merged commit 5ef7cdc into next Jun 22, 2021
@imjoehaines imjoehaines deleted the fix-railtie-undefined-method-error branch June 22, 2021 09:27
imjoehaines added a commit that referenced this pull request Jun 23, 2021
@imjoehaines imjoehaines mentioned this pull request Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants